﻿using System;
using System.Collections.Generic;
using System.Text;

namespace DAO
{
    public static class GlobalSettings
    {
        public static readonly string PASSPHRASE = "NinoMur@tovski123";           // can be any string
        public static readonly string SALTVALUE = "t@xchange55";            // can be any string
        public static readonly string HASHALGORITHAM = "SHA1";            // can be "MD5"
        public static readonly int PASSWORDITERATIONS = 2;                // can be any number
        public static readonly string INITVECTOR = "@2B1c4D3e6F5g8H7";    // must be 16 bytes
        public static readonly int KEYSIZE = 256;                         // can be 192 or 128

        public static string Encrypt(string s)
        {
            string cipherText = DAO.Rijndael.Encrypt(s,
                                                    PASSPHRASE,
                                                    SALTVALUE,
                                                    HASHALGORITHAM,
                                                    PASSWORDITERATIONS,
                                                    INITVECTOR,
                                                    KEYSIZE);
            return cipherText;
        }

        public static string Decrypt(string s)
        {
            string cipherText = DAO.Rijndael.Decrypt(s,
                                                    PASSPHRASE,
                                                    SALTVALUE,
                                                    HASHALGORITHAM,
                                                    PASSWORDITERATIONS,
                                                    INITVECTOR,
                                                    KEYSIZE);
            return cipherText;
        }
    }
}
